package edu.zju.gis.dbfg.common.exception;


import edu.zju.gis.dbfg.common.base.BaseException;
import edu.zju.gis.dbfg.common.constant.CodeConstants;
import edu.zju.gis.dbfg.common.constant.DaoMethod;

/**
 * 数据访问异常
 */
public class DaoException extends BaseException {

    private static final long serialVersionUID = -7980532772047897013L;

    public static final String MESSAGE = "数据访问异常";

    public DaoException(DaoMethod entity, String method, String data){
        super(CodeConstants.DAO_ERROR, String.format("数据访问异常：%s, %s, %s", method, entity.getName(), data));
    }

    public DaoException(int code, DaoMethod entity, String method, String data){
        super(code, String.format("数据访问异常：%s, %s, %s", method, entity.getName(), data));
    }

}
